<?php
namespace source\libs;

use yii\helpers\ArrayHelper;
/**
 * ChannelController implements the CRUD actions for Channel model.
 */
class Constants
{

    const TabSize = '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;';

    public static function getSortNum()
    {
        return time();
    }

    const YesNo_Yes = 1;
    const YesNo_No = 0;
    public static function getYesNoItems($key = null)
    {
        $items = [
            self::YesNo_Yes => '是', 
            self::YesNo_No => '否'
        ];
        return ArrayHelper::getItems($items, $key);
    }

    const Status_Enable = 1;
    const Status_Desable = 0;
    public static function getStatusItems($key = null)
    {
        $items = [
            self::Status_Enable => '可用', 
            self::Status_Desable => '禁用'
        ];
        return ArrayHelper::getItems($items, $key);
    }

    const Target_Self = '_self';
    const Target_blank = '_blank';
    public static function getTargetItems($key = null)
    {
        $items = [
            self::Target_Self => '当前窗口', 
            self::Target_blank => '新窗口'
        ];
        return ArrayHelper::getItems($items, $key);
    }

    const Visibility_Public = '1';
    const Visibility_Hidden = '2';
    const Visibility_Password = '3';
    const Visibility_Private = '4';
    public static function getVisibilityItems($key = null)
    {
        $items = [
            self::Visibility_Public => '公开', 
            self::Visibility_Hidden => '回复可见', 
            self::Visibility_Password => '密码保护', 
            self::Visibility_Private => '私有'
        ];
        return ArrayHelper::getItems($items, $key);
    }

    const Status_Publish = '1';
    const Status_Draft = '2';
    const Status_Pending = '3';
    public static function getStatusItemsForContent($key = null)
    {
        $items = [
            self::Status_Publish => '发布', 
            self::Status_Draft => '草稿', 
            self::Status_Pending => '等待审核'
        ];
        return ArrayHelper::getItems($items, $key);
    }

    public static function getRecommendItems($key = null)
    {
        $items = [
            // 0 => '无',
            1 => '一级推荐', 
            2 => '二级推荐', 
            3 => '三级推荐', 
            4 => '四级推荐', 
            5 => '五级推荐', 
            6 => '六级推荐', 
            7 => '七级推荐', 
            8 => '八级推荐', 
            9 => '九级推荐'
        ];
        return ArrayHelper::getItems($items, $key);
    }

    public static function getHeadlineItems($key = null)
    {
        $items = [
            // 0 => '无',
            1 => '一级头条', 
            2 => '二级头条', 
            3 => '三级头条', 
            4 => '四级头条', 
            5 => '五级头条', 
            6 => '六级头条', 
            7 => '七级头条', 
            8 => '八级头条', 
            9 => '九级头条'
        ];
        return ArrayHelper::getItems($items, $key);
    }

    public static function getStickyItems($key = null)
    {
        $items = [
            // 0 => '无',
            1 => '一级置顶', 
            2 => '二级置顶', 
            3 => '三级置顶', 
            4 => '四级置顶', 
            5 => '五级置顶', 
            6 => '六级置顶', 
            7 => '七级置顶', 
            8 => '八级置顶', 
            9 => '九级置顶'
        ];
        
        return ArrayHelper::getItems($items, $key);
    }
    
    public static function getEqtSort($key = null)
    {
    	$items = [
    			0 => '主观题',
    			1 => '客观题',
    	];
    
    	return ArrayHelper::getItems($items, $key);
    }
    
    public static function getEqtChoice($key = null)
    {
    	$items = [
    			1 => '单选',
    			2 => '多选',
    			3 => '判断',
    			4 => '问答',
    			5 => '填空题',
    	];
    
    	return ArrayHelper::getItems($items, $key);
    }
    
    public static function getEqtLevel($key = null)
    {
    	$items = [
    			1 => '易',
    			2 => '中',
    			3 => '难',
    	];
    
    	return ArrayHelper::getItems($items, $key);
    }
    
    //题目 备选项数量
    public static function getEqtSelectNumber($key = null)
    {
    	$items = [
    			0 => '0',
    			2 => '2',
    			4 => '4',
    			5 => '5',
    			6 => '6',
    	];
    
    	return ArrayHelper::getItems($items, $key);
    }
    
    //题目 答案选项
    public static function getEqtAnswer($key = null)
    {
    	$items = [
    			'A' => 'A',
    			'B' => 'B',
    			'C' => 'C',
    			'D' => 'D',
    			'E' => 'E',
    			'F' => 'F',
    	];
    
    	return ArrayHelper::getItems($items, $key);
    }
    
    //题目 判断答案选项
    public static function getEqtTFAnswer($key = null)
    {
    	$items = [
    			'A' => '对',
    			'B' => '错',
    	];
    
    	return ArrayHelper::getItems($items, $key);
    }
    
    public static function getEpType($key = null)
    {
    	$items = [
    			'1' => '手工组卷',
    			'2' => '随机组卷',
    	];
    
    	return ArrayHelper::getItems($items, $key);
    }
    
    public static function getEpDecide($key = null)
    {
    	$items = [
    			'1' => '他评',
    			'2' => '自评',
    	];
    
    	return ArrayHelper::getItems($items, $key);
    }
    
    const ErType_Easy = 1;
    const ErType_Middle = 2;
    const ErType_Hard = 3;
    public static function getErType($key = null)
    {
    	$items = [
    			self::ErType_Easy => '系统随机',
    			self::ErType_Middle => '指定试卷',
    			self::ErType_Hard => '随机指定试卷',
    	];
    
    	return ArrayHelper::getItems($items, $key);
    }
    
}
